const san = require('/js-modules/common/san/san.js')

const Progress = san.defineComponent({
    template: `
        <div class="s-progreess">
            <div class="s-p-item" s-for="v, k in progress">
                <span class="p-icon">
                    <i s-if="k < active" class="iconfont p-ok">&#xe744;</i>
                    <template s-else>
                        <span class="{{k <= active ? '' : 'text'}}">{{k + 1}}</span>
                        <i s-if="k <= active" class="iconfont">&#xe6d0;</i>
                        <i s-else class="iconfont p-un-circle">&#xe758;</i>
                    </template>
                </span>
                <strong class="p-title {{k <= active ? 'p-active-title' : 'p-un-title'}}">{{v.label}}</strong>
                <b s-if="k != (progress.length - 1)" class="p-line  {{k < active ? 'p-active-line' : ''}}"></b>
            </div>
        </div>
    `
})

module.exports = Progress